package com.ming.demo.service.impl;

import com.ming.demo.mapper.InfoPeopleMapper;
import com.ming.demo.model.InfoPeople;
import com.ming.demo.service.InfoPeopleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.stereotype.Service;

@Service
public class InfoPeopleServiceImpl implements InfoPeopleService {
    @Autowired
    private InfoPeopleMapper infoPeopleMapper;

    @Autowired
    private MongoTemplate mongoTemplate;

    @Override
    public InfoPeople insertIntoPeople(InfoPeople infoPeople) {
        InfoPeople infoPeople1 = mongoTemplate.save(infoPeople);
        if(infoPeople1 != null) {
            return infoPeople1;
        }else {
            return null;
        }
    }
}
